<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class C_login extends CI_Controller {

	/**
	 * Index Page for this controller.
	 *
	 * Maps to the following URL
	 * 		http://example.com/index.php/welcome
	 *	- or -  
	 * 		http://example.com/index.php/welcome/index
	 *	- or -
	 * Since this controller is set as the default controller in 
	 * config/routes.php, it's displayed at http://example.com/
	 *
	 * So any other public methods not prefixed with an underscore will
	 * map to /index.php/welcome/<method_name>
	 * @see http://codeigniter.com/user_guide/general/urls.html
	 */
	public function index(){
		$this->template->set_template('login');
		// Write to $header
		//$this->template->write('header', PROJECT_NAME);
		$this->template->write('title', PROJECT_NAME);
		
		//$this->template->write_view('menu', 'main/v_login_form');
		
		//$this->template->write_view('content', 'main/v_berita');
		
		// Write to $sidebar
		//$this->template->write('footer', 'Footer');
		
		// Render the template
		$this->template->render();
	}
	
	function do_login(){
		$username=$_POST["username"];
		$password=md5($_POST["password"]);
		
		$success = $this->auth->do_login($username,$password);
		
		return $success;
	}
	
}

/* End of file welcome.php */
/* Location: ./application/controllers/welcome.php */